package com.googlecode.bip.entity;

/**
 * Indicate bad value for 'value'
 */
public class IllegalValueException extends IllegalAttributeException
{
    private static final long serialVersionUID = 1L;

    /**
     * Create an IllegalValueException based on values
     *
     * @param value Incorrect value
     * @param min   Range minimum value
     * @param max   Range maximum value
     */
    public IllegalValueException( final int value, final int min, final int max )
    {
        super( Integer.toString( value )
                + " not in range ["
                + min
                + ".."
                + max
                + "]"
                );
    }

    /**
     * Create an IllegalValueException based on a message
     *
     * @param message Exception message
     */
    public IllegalValueException( final String message )
    {
        super( message );
    }

}
